package com.yidu.best.systemManagement.Authority.domain;

import java.util.List;

public class AuthorityRole {
	private String roleId;
	private String roleName;
	private List<AuthorityResource> resources;
	
	public AuthorityRole() {
	}

	public AuthorityRole(String roleId, String roleName, List<AuthorityResource> resources) {
		super();
		this.roleId = roleId;
		this.roleName = roleName;
		this.resources = resources;
	}

	@Override
	public String toString() {
		return "AuthorityRole [roleId=" + roleId + ", roleName=" + roleName + ", resources=" + resources + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((resources == null) ? 0 : resources.hashCode());
		result = prime * result + ((roleId == null) ? 0 : roleId.hashCode());
		result = prime * result + ((roleName == null) ? 0 : roleName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AuthorityRole other = (AuthorityRole) obj;
		if (resources == null) {
			if (other.resources != null)
				return false;
		} else if (!resources.equals(other.resources))
			return false;
		if (roleId == null) {
			if (other.roleId != null)
				return false;
		} else if (!roleId.equals(other.roleId))
			return false;
		if (roleName == null) {
			if (other.roleName != null)
				return false;
		} else if (!roleName.equals(other.roleName))
			return false;
		return true;
	}

	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public List<AuthorityResource> getResources() {
		return resources;
	}

	public void setResources(List<AuthorityResource> resources) {
		this.resources = resources;
	}
}
